<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>position:absolute</title>
    <style>
      body {
        margin: 20px;
        font-size: 14px;
      }
      #father {
        background-color: #377be5;
        border: 1px dashed #000;
        width: 500px;
        height: 500px;
      }
      #box {
        background-color: #ebe482;
        border: 1px dashed #000;
        padding: 20px;
        position: relative; /*absolute绝对对定位*/
        left: 0px; /*box的左边框距离页面左侧38px(即距离body左侧38px，不是距离它的父元素father);*/
        top: 8px; /*box的上边框距离页面顶部40px(即距离body顶部58px，不是距离它的父元素father)*/
      }
      #box2 {
        background-color: #39ec6a;
        border: 1px dashed #000;
        padding: 20px;
      }
    </style>
  </head>
  <body>
    <div id="father">
      <div id="box">box</div>
      <div id="box2">box2</div>
    </div>
  </body>
</html>
